package hotel.switchs.oversea.biz.mapper;

import hotel.base.oversea.repository.MyMapper;
import hotel.switchs.oversea.api.entity.SwitchPushRoomDataAllEntity;
import hotel.switchs.oversea.api.entity.SwitchPushRoomDataEntity;
import org.apache.ibatis.annotations.Param;

/**
 * @Author lmf
 * @Date 2020/6/22 14:58
 **/
public interface SwitchPushRoomDataMapper extends MyMapper<SwitchPushRoomDataEntity> {
    /**
     * 根据子酒店id 和 售卖房型id 获取数据
     * @param hotelId
     * @param roomId
     * @return
     */
    SwitchPushRoomDataAllEntity selectByHotelIdAndRoomId(@Param("hotelId") int hotelId, @Param("roomId") int roomId, @Param("startDate") String startDate);

    /**
     * 根据子酒店id 和 售卖房型id 获取数据
     * @param hotelId
     * @param roomId
     * @param time
     * @return
     */
    SwitchPushRoomDataAllEntity getMtRoomIdByHotelIdAndRoomId(@Param("hotelId") int hotelId, @Param("roomId") int roomId, @Param("time") String time);

    /**
     * 根据产品id和日期获取数据
     * @param mtGoodId
     * @param time
     * @return
     */
    SwitchPushRoomDataAllEntity selectByGoodIdAndTime(@Param("mtGoodId") int mtGoodId, @Param("time") String time);

    /**
     * 获取售卖房型推送价格最晚时间
     * 比如上次推到 6月8号
     * 再次推送就是 从9号开始推送
     * @param hotelId
     * @param basicRoomTypeId
     * @return
     */
    SwitchPushRoomDataEntity getLastPushDate(@Param("hotelId") int hotelId, @Param("roomId") int basicRoomTypeId);
    /**
     * @author: lmf
     * @date: 2020/8/7 18:25
     *  获取售卖房型推送价格记录
     */
    SwitchPushRoomDataEntity selectByRoomId(@Param("roomId") Integer roomId);
    /**
     * @author: lmf
     * @date: 2020/8/10 15:01
     * 根据id 推送日期start_time
     */
    int updateStartTimeById(@Param("endTime") String endTime, @Param("pid") String pid);
    /**
     *
     * @author: lmf
     * @time: 2020/10/29 15:17
     * 删除售卖房型记录
     */
    int deleteByRoomId(@Param("roomId") Integer roomId);
}
